package com.example.demo.security;

import org.springframework.security.core.context.SecurityContextHolder;

/**
 * <p>
 *
 * </p>
 *
 * @author e-Xiaoyuan.Wang
 * @since 2022/7/4 9:46
 */
public class SecurityUtils {

    public static SecurityUser getCurrentUser() {
        return (SecurityUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
